package jwdt.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Constant {
	
	public static final String YES = "Y";
	public static final String NO = "N";
	
	public static final String PUBLIC_LIBS = "PUBLIC_LIBS";
	
	public static final String MVC = "MVC";
	public static final String MVC_STRUTS = "struts";
	public static final String MVC_STRUTS2 = "struts2";
	public static final String MVC_SPRINGMVC = "springMVC";
	
	public static final String IOC = "IOC";
	public static final String IOC_SPRING = "spring";
	
	public static final String ORM = "ORM";
	public static final String ORM_HIBERNATE = "hibernate";
	public static final String ORM_IBATIS = "ibatis";
	
	public static final String PAGE = "PAGE";
	public static final String PAGE_EXTJS = "extjs";
	public static final String PAGE_JEASYUI = "jeasyui";
	
	public static final String PAGE_BASE = "sources/pagebase/";
	
	public static final String SYSMENU_BASE = "sources/sysmenu/";
	
	public static final String SINGLE_DATASOURCE = "singleDataSource";	
	public static final String MULTIPLE_DATASOURCE = "multipleDataSource";
	
	public static final String DB_TYPE_MYSQL = "MYSQL";	
	public static final String DB_TYPE_ORACLE = "ORACLE";	
	public static final String DB_TYPE_DB2 = "DB2";	
	public static final String DB_TYPE_SQLSERVER = "SQLSERVER";	
		
	//数据类型下拉菜单
	public static final String[] DB_TYPE = {
												DB_TYPE_MYSQL 
												,DB_TYPE_ORACLE
												//,DB_TYPE_DB2 
												//,DB_TYPE_SQLSERVER 
											};
	
	//driverClass
	public static final Map<String,String> DB_TYPE_DRIVERCLASS_MAP=new HashMap<String,String>();
	static{
		DB_TYPE_DRIVERCLASS_MAP.put(DB_TYPE_MYSQL, "com.mysql.jdbc.Driver");
		DB_TYPE_DRIVERCLASS_MAP.put(DB_TYPE_ORACLE, "oracle.jdbc.driver.OracleDriver");
		DB_TYPE_DRIVERCLASS_MAP.put(DB_TYPE_DB2, "com.ibm.db2.jcc.DB2Driver");
		DB_TYPE_DRIVERCLASS_MAP.put(DB_TYPE_SQLSERVER, "com.microsoft.sqlserver.jdbc.SQLServerDriver");
	}
	//xaDataSourceClass
	public static final Map<String,String> DB_TYPE_XADATASOURCECLASS_MAP=new HashMap<String,String>();
	static{
		DB_TYPE_XADATASOURCECLASS_MAP.put(DB_TYPE_MYSQL, "com.mysql.jdbc.jdbc2.optional.MysqlXADataSource");
		DB_TYPE_XADATASOURCECLASS_MAP.put(DB_TYPE_ORACLE, "oracle.jdbc.xa.client.OracleXADataSource");
		DB_TYPE_XADATASOURCECLASS_MAP.put(DB_TYPE_DB2, "com.ibm.db2.jcc.DB2XADataSource");
		DB_TYPE_XADATASOURCECLASS_MAP.put(DB_TYPE_SQLSERVER, "com.microsoft.sqlserver.jdbc.SQLServerXADataSource");
	}
	//dialect
	public static final Map<String,String> DB_TYPE_DIALECT_MAP=new HashMap<String,String>();
	static{
		DB_TYPE_DIALECT_MAP.put(DB_TYPE_MYSQL, "org.hibernate.dialect.MySQLDialect");
		DB_TYPE_DIALECT_MAP.put(DB_TYPE_ORACLE, "org.hibernate.dialect.OracleDialect");
	}
	
	public static final String DATASOURCE_TYPE_JDBC="Jdbc";
	public static final String DATASOURCE_TYPE_JNDI="Jndi";
		
	public static final Map<String,String> SPRING_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		SPRING_RESOURCE_LINK_MAP.put("aopalliance.jar", "/sources/libs/ioc/spring/aopalliance.jar");
		SPRING_RESOURCE_LINK_MAP.put("aspectjrt.jar", "/sources/libs/ioc/spring/aspectjrt.jar");
		SPRING_RESOURCE_LINK_MAP.put("aspectjweaver.jar", "/sources/libs/ioc/spring/aspectjweaver.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-aop-3.2.2.jar", "/sources/libs/ioc/spring/spring-aop-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-aspects-3.2.2.jar", "/sources/libs/ioc/spring/spring-aspects-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-beans-3.2.2.jar", "/sources/libs/ioc/spring/spring-beans-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-context-3.2.2.jar", "/sources/libs/ioc/spring/spring-context-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-core-3.2.2.jar", "/sources/libs/ioc/spring/spring-core-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-expression-3.2.2.jar", "/sources/libs/ioc/spring/spring-expression-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-instrument-3.2.2.jar", "/sources/libs/ioc/spring/spring-instrument-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-jdbc-3.2.2.jar", "/sources/libs/ioc/spring/spring-jdbc-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-jms-3.2.2.jar", "/sources/libs/ioc/spring/spring-jms-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-orm-3.2.2.jar", "/sources/libs/ioc/spring/spring-orm-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-oxm-3.2.2.jar", "/sources/libs/ioc/spring/spring-oxm-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-tx-3.2.2.jar", "/sources/libs/ioc/spring/spring-tx-3.2.2.jar");
		SPRING_RESOURCE_LINK_MAP.put("spring-web-3.2.2.jar", "/sources/libs/ioc/spring/spring-web-3.2.2.jar");
	}
	public static final Map<String,String> SPRINGMVC_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		SPRINGMVC_RESOURCE_LINK_MAP.put("spring-webmvc-3.2.2.jar", "/sources/libs/mvc/springMVC/spring-webmvc-3.2.2.jar");
	}
	public static final Map<String,String> STRUTS2_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		STRUTS2_RESOURCE_LINK_MAP.put("struts2-core-2.3.15.1.jar", "/sources/libs/mvc/struts2/struts2-core-2.3.15.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("struts2-spring-plugin-2.3.15.1.jar", "/sources/libs/mvc/struts2/struts2-spring-plugin-2.3.15.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("xwork-core-2.3.15.1.jar", "/sources/libs/mvc/struts2/xwork-core-2.3.15.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("ognl-3.0.6.jar", "/sources/libs/mvc/struts2/ognl-3.0.6.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("freemarker-2.3.8.jar", "/sources/libs/mvc/struts2/freemarker-2.3.8.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("struts2-json-plugin-2.3.15.1.jar", "/sources/libs/mvc/struts2/struts2-json-plugin-2.3.15.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("struts2-convention-plugin-2.3.15.1.jar", "/sources/libs/mvc/struts2/struts2-convention-plugin-2.3.15.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("javassist-3.11.0.GA.jar", "/sources/libs/mvc/struts2/javassist-3.11.0.GA.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("commons-lang3-3.1.jar", "/sources/libs/public/commons/commons-lang3-3.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("commons-fileupload-1.3.jar", "/sources/libs/public/commons/commons-fileupload-1.3.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("commons-io-2.0.1.jar", "/sources/libs/public/commons/commons-io-2.0.1.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("asm-3.3.jar", "/sources/libs/mvc/struts2/asm-3.3.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("asm-commons-3.3.jar", "/sources/libs/mvc/struts2/asm-commons-3.3.jar");
		STRUTS2_RESOURCE_LINK_MAP.put("asm-tree-3.3.jar", "/sources/libs/mvc/struts2/asm-tree-3.3.jar");
	}	
	public static final Map<String,String> IBATIS_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		IBATIS_RESOURCE_LINK_MAP.put("ibatis-2.3.4.726.jar", "/sources/libs/orm/ibatis/ibatis-2.3.4.726.jar");
		//cglib
		IBATIS_RESOURCE_LINK_MAP.put("cglib-nodep-2.1_3.jar", "/sources/libs/orm/cglib-nodep-2.1_3.jar");
	}
	public static final Map<String,String> HIBERNATE_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		HIBERNATE_RESOURCE_LINK_MAP.put("hibernate3.jar", "/sources/libs/orm/hibernate/hibernate3.jar");
		HIBERNATE_RESOURCE_LINK_MAP.put("hibernate-annotations.jar", "/sources/libs/orm/hibernate/hibernate-annotations.jar");
		HIBERNATE_RESOURCE_LINK_MAP.put("hibernate-commons-annotations.jar", "/sources/libs/orm/hibernate/hibernate-commons-annotations.jar");
		//cglib
		HIBERNATE_RESOURCE_LINK_MAP.put("cglib-nodep-2.1_3.jar", "/sources/libs/orm/cglib-nodep-2.1_3.jar");
		//xml
		HIBERNATE_RESOURCE_LINK_MAP.put("dom4j-1.6.jar", "/sources/libs/public/xml/dom4j-1.6.jar");
		//commons
		HIBERNATE_RESOURCE_LINK_MAP.put("commons-collections.jar", "/sources/libs/public/commons/commons-collections.jar");
		//antlr
		HIBERNATE_RESOURCE_LINK_MAP.put("antlr-2.7.6.jar", "/sources/libs/orm/hibernate/antlr-2.7.6.jar");
	}
	public static final Map<String,String> SINGLE_DATASOURCE_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		SINGLE_DATASOURCE_RESOURCE_LINK_MAP.put("commons-dbcp.jar", "/sources/libs/db/datasource/dbcp/commons-dbcp.jar");
		SINGLE_DATASOURCE_RESOURCE_LINK_MAP.put("commons-pool.jar", "/sources/libs/db/datasource/dbcp/commons-pool.jar");
	}
	public static final Map<String,String> MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("atomikos-util.jar", "/sources/libs/db/datasource/atomikos/atomikos-util.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("transactions.jar", "/sources/libs/db/datasource/atomikos/transactions.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("transactions-api.jar", "/sources/libs/db/datasource/atomikos/transactions-api.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("transactions-jdbc.jar", "/sources/libs/db/datasource/atomikos/transactions-jdbc.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("transactions-jdbc-deprecated.jar", "/sources/libs/db/datasource/atomikos/transactions-jdbc-deprecated.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("transactions-jta.jar", "/sources/libs/db/datasource/atomikos/transactions-jta.jar");
		MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP.put("ow2-jta-1.1-spec.jar", "/sources/libs/db/jta/ow2-jta-1.1-spec.jar");		
	}	
	public static final Map<String,String> MYSQL_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		MYSQL_RESOURCE_LINK_MAP.put("mysql-connector-java-5.1.25-bin.jar", "/sources/libs/db/jdbcdrivers/mysql/mysql-connector-java-5.1.25-bin.jar");
	}
	public static final Map<String,String> ORACLE_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		ORACLE_RESOURCE_LINK_MAP.put("classes12.jar", "/sources/libs/db/jdbcdrivers/oracle/classes12.jar");
	}
	public static final Map<String,String> DB2_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		DB2_RESOURCE_LINK_MAP.put("db2jcc.jar", "/sources/libs/db/jdbcdrivers/db2/db2jcc.jar");
		DB2_RESOURCE_LINK_MAP.put("db2jcc_license_cu.jar", "/sources/libs/db/jdbcdrivers/db2/db2jcc_license_cu.jar");
	}
	public static final Map<String,String> SQLSERVER_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		SQLSERVER_RESOURCE_LINK_MAP.put("sqljdbc.jar", "/sources/libs/db/jdbcdrivers/sqlserver/sqljdbc.jar");
	}
	public static final Map<String,String> PUBLIC_RESOURCE_LINK_MAP=new HashMap<String,String>();
	static{
		//jstl
		PUBLIC_RESOURCE_LINK_MAP.put("standard.jar", "/sources/libs/public/jstl/standard.jar");
		//log
		PUBLIC_RESOURCE_LINK_MAP.put("log4j-1.2.15.jar", "/sources/libs/public/log/log4j-1.2.15.jar");
		PUBLIC_RESOURCE_LINK_MAP.put("commons-logging.jar", "/sources/libs/public/log/commons-logging.jar");
		//json
		PUBLIC_RESOURCE_LINK_MAP.put("jackson-all-1.8.10.jar", "/sources/libs/public/json/jackson-all-1.8.10.jar");		
		//jwdt
		PUBLIC_RESOURCE_LINK_MAP.put("jwdt-util.jar", "/sources/libs/public/jwdt/jwdt-util.jar");		
	}
	public static final Map<String, Map<String,String>> INITPROFRAMEWORK_RESOURCE_RULE_MAP=new HashMap<String, Map<String,String>>();
	static{
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(IOC_SPRING, SPRING_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(MVC_SPRINGMVC, SPRINGMVC_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(MVC_STRUTS2, STRUTS2_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(ORM_IBATIS, IBATIS_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(ORM_HIBERNATE, HIBERNATE_RESOURCE_LINK_MAP);
		
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(SINGLE_DATASOURCE, SINGLE_DATASOURCE_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(MULTIPLE_DATASOURCE, MULTIPLE_DATASOURCE_RESOURCE_LINK_MAP);
		
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(DB_TYPE_MYSQL, MYSQL_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(DB_TYPE_ORACLE, ORACLE_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(DB_TYPE_DB2, DB2_RESOURCE_LINK_MAP);
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(DB_TYPE_SQLSERVER, SQLSERVER_RESOURCE_LINK_MAP);
		
		INITPROFRAMEWORK_RESOURCE_RULE_MAP.put(PUBLIC_LIBS, PUBLIC_RESOURCE_LINK_MAP);
	}
	
	public static final List<String> PROJECT_FILE_TYPES = new ArrayList<String>();
	public static final String PROJECT_FILE_TYPE_PAGE = "page";
	public static final String PROJECT_FILE_TYPE_WEB = "web";
	public static final String PROJECT_FILE_TYPE_SERVICE = "service";
	public static final String PROJECT_FILE_TYPE_DAO = "dao";
	public static final String PROJECT_FILE_TYPE_ORM = "orm";
	static{
		PROJECT_FILE_TYPES.add(PROJECT_FILE_TYPE_PAGE);
		PROJECT_FILE_TYPES.add(PROJECT_FILE_TYPE_WEB);
		PROJECT_FILE_TYPES.add(PROJECT_FILE_TYPE_SERVICE);
		PROJECT_FILE_TYPES.add(PROJECT_FILE_TYPE_DAO);	
		PROJECT_FILE_TYPES.add(PROJECT_FILE_TYPE_ORM);	
	}
}
